<template>
	<view>
		<!-- 校宇通 -->
		<view v-if="getEnv" class="content">
			<!-- 导航条 -->
			<view class="nav">
				<u-navbar back-icon-name="" :border-bottom="false" :background="{ backgroundColor: '#f14500' }" title-color="#FFF"
					title="校宇通" @rightClick="rightClick" :autoBack="true">
				</u-navbar>
				<view class="image">
					<swiper class="swiper" circular indicator-active-color="#fff" :indicator-dots="true" :autoplay="true"
						:interval="2000" :duration="500">
						<swiper-item v-for="item in slideshowList" :key="item.image">
							<image :src="item.image" style="width: 100%;height: 100%;border-radius: 8rpx;">
							</image>
						</swiper-item>

					</swiper>
				</view>

			</view>

			<!-- 分类 -->
			<Type></Type>
			<!-- 今日资讯 -->
			<Information ref="InformationRef" :isHader="true"></Information>
			<!-- 发布 -->
			<Add></Add>
		</view>
		<DeceiveXiaoyutong v-else></DeceiveXiaoyutong>
	</view>
</template>

<script>
import DeceiveXiaoyutong from "@/components/Deceive/DeceiveXiaoyutong.vue";
import getEnv from "@/utils/getEnv.js";
import Type from './Type.vue'
import Information from './Information.vue'
import Add from './Add.vue'
const $api = require('@/utils/request.js').API

export default {
	components: {
		Type,
		Information,
		Add,
		DeceiveXiaoyutong
	},
	data() {
		return {
			getEnv: getEnv(),
			slideshowList: []
		}
	},
	onLoad() {
		this.getBannerList()
		this.$refs.InformationRef.getPostList()
	},

	methods: {
		getBannerList() {
			$api.bannerList().then(res => {
				console.log(res.data.data);
				this.slideshowList = res.data.data
				this.slideshowList.forEach(item => {
					item.image = this.$image + item.image
				})
			})
		}
	}
}
</script>

<style lang="less" scoped>
.content {
	.nav {
		height: 350rpx;
		background: url(../../static/xiaoyutong/back.png);
		background-size: 100% 100%;
		font-size: 32rpx;
		font-weight: 500;
		color: #fff;
	}
}
</style>

